package edu.sjb.map;

import edu.sjb.Drawable;
import edu.sjb.characters.GameCharacter;
import edu.sjb.characters.Mario;
import edu.sjb.constants.ImageConstants;

public class MapBrick extends MapObject {

	public MapBrick() {
		super();
	}

	@Override
	public void hitAgainstMario(Mario m) {
		m.setUnderMushroomEffect(false);
		m.stopLeft();
		m.stopRight();
		if (m.posY() <= posY()) {
			m.setPosY(posY() - m.sizeY());
		}
		else {
			m.setUnderMushroomEffect(false);
		}
	}

	@Override
	public void characterCollide(GameCharacter afectado) {
	}

	@Override
	public void run() {
	}

	protected Object clone() {

		MapBrick nuevo = new MapBrick();
		Drawable nuevaImagen = new Drawable(ImageConstants.BRICK_QM, false);
		nuevo.setImage(nuevaImagen);
		return nuevo;
	}

}
